import Vue from "vue";
import VueRouter from "vue-router";

import LoginView from "@/views/login/LoginView";
import LayoutView from "@/views/layout/LayoutView";

import DashboardView from "@/views/dashboard/DashboardView.vue";
import ProductCategoryView from "@/views/product/category/ProductCategoryView";

Vue.use(VueRouter);

const routes = [
  // 首页
  {
    path: "/",
    component: LayoutView,
    redirect: "/dashboard",
    children: [
      {
        path: "/dashboard",
        component: DashboardView,
      },
    ],
  },
  // 商品管理
  {
    path: "/product",
    component: LayoutView,
    redirect: "/product/category",
    children: [
      {
        path: "/product/category",
        component: ProductCategoryView,
      },
      {
        path: "/product/list",
        // component: listView,
      },
      {
        path: "/product/cteate",
        // component: createView,
      },
    ],
  },
  // ...... 自己后期根据项目进度整理相关路由
  {
    path: "/login",
    component: LoginView,
  },
  // {
  //   path: "/register",
  //   component: LoginView,
  // },

  // {
  //   path: "/register",
  //   component:
  // }
];

const router = new VueRouter({
  routes,
});

export default router;
